package cn.hss.map;

import java.util.LinkedHashMap;

/**
 * @author 作者：HeShaoShuai
 * @Email 邮箱：2569819541@qq.com
 * @Date 日期：2023/4/27 17:01
 * @Package 包名：cn.hss.map
 * @Project 项目名：JavaSE
 * @Version 1.0
 */
public class LinkedHashMapDemo {
	public static void main(String[] args) {
		LinkedHashMap<Integer, String> linkedHashMap =
				new LinkedHashMap<>();
		linkedHashMap.put(1001,"张三");
		linkedHashMap.put(1002,"李四");
		linkedHashMap.put(1003,"王五");
		linkedHashMap.put(1004,"张三");
		linkedHashMap.forEach((key,value)->
				System.out.println(key+":"+value));
		linkedHashMap.put(null,null);
		linkedHashMap.put(null,"好老婆");
		linkedHashMap.forEach((key,value)->
				System.out.println(key+":"+value));
	}
}
